package me.caofeng.service.api;

import com.github.pagehelper.PageInfo;
import com.sun.org.apache.regexp.internal.RE;
import me.caofeng.enums.Role;
import me.caofeng.pojo.Page;
import me.caofeng.pojo.Product;
import me.caofeng.pojo.Response;

import javax.print.DocFlavor;
import java.security.interfaces.RSAKey;
import java.util.List;

/**
 * Copyright © 2017曹峰. All rights reserved.
 *
 * @Prject: mall
 * @Package: me.caofeng.service.api
 * @Description:
 * @Author: 曹峰 blog.caofeng.me
 * @Date: 2017-06-20 22:35
 * @Version: V1.0
 */
public interface IProductService {
    /**
     * @Author:曹峰 blog.caofeng.me
     * @Date: 2017/6/20 22:35
     * @Description: 添加商品
     */
    Response<Product> addProduct(Product product);

    /**
     * @Author:曹峰 blog.caofeng.me
     * @Date: 2017/6/23 23:46
     * @Description: 根据商品id获取商品详情
     */
    Response<Product> getProduct(Integer id,Role role);

    /**
     * @Author:曹峰 blog.caofeng.me
     * @Date: 2017/6/23 23:46
     * @Description: 更新产品信息
     */
    Response<Product> updateProduct(Product product, Integer id);

    /**
     * @Author:曹峰 blog.caofeng.me
     * @Date: 2017/6/23 23:46
     * @Description: 更新商品状态
     */
    Response updateProductStatus(Integer id, Integer status);

    /**
     * @param pageNum    显示的页面
     * @param pageSize   每页大小
     * @param categoryId 商品所属分类
     * @param role       用户角色
     * @Author:曹峰 blog.caofeng.me
     * @Date: 2017/6/23 23:46
     * @Description: 获取商品列表，返回结果中包含分页指示
     */
    Response<PageInfo<List<Product>>> getProductsAsPageInfo(
            Integer pageNum, Integer pageSize,
            Integer categoryId, String key , Integer status,
            Role role);

    Response<Page<List<Product>>>  getProductsAsPage(
            Integer pageNum,Integer pageSize,
            Integer categoryId,String key ,Integer status,
            Role role);


}
